#include <stdio.h>
#include <string.h>
int getindex(char *w[], char *s);
int main()
{
    int n;
    char *week[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thurday", "Friday", "Saturday"}, str[20];
    gets(str);
    n = getindex(week, str);
    if (n == -1)
        printf("wrong  input!");
    else
        printf("%d", n);
    return 0;
}

int getindex(char *w[], char *s)
{
    for (int i = 0; i < 7;i++)
    {
        if(*(w[i]) == *s)
        {
            int flag = 1;
            for (int j = 0; j < strlen(w[i]);j++)
            {
                if(*(w[i]+j) != *(s+j))
                    flag = 0;
            }
            if(flag)
                return i;
        }
    }
    return -1;
}